package com.ry.novel.service;

import com.ry.novel.model.dto.BookIndexInfo;
import com.ry.novel.model.entity.Book;
import com.ry.novel.model.entity.BookIndex;

import java.util.List;
import java.util.Map;

/**
 * @author ry
 * @since 2022-01-24 09:50
 **/
public interface BookIndexService {

    /**
     * 审核中的章节
     * @param bookId
     * @return
     */
    List<BookIndexInfo> queryReviewIndexByBookId(Long bookId);

    /**
     * 审核通过的章节
     * @param bookId
     * @return
     */
    List<BookIndexInfo> queryPassedIndexByBookId(Long bookId);

    /**
     * 审核不通过的章节
     * @param bookId
     * @return
     */
    List<BookIndexInfo> queryBiddenIndexByBookId(Long bookId);

    Map<String,List<BookIndexInfo>> bookIndexList(Long bookId);

    /**
     * 根据bookId查询最新章节的num
     * @param bookId
     * @return
     */
    Integer lastIndexNum(Long bookId);

    /**
     * 作者发布章节
     */
    void authorPublishBookIndex(BookIndexInfo bookIndexInfo);


    /**
     * 作者修改章节
     */
    void authorUpdateBookIndex(BookIndexInfo info);


    /**
     * 查询小说的第一章
     * @param bookId
     */
    BookIndexInfo readFirstIndex(Long bookId);


    /**
     * 根据章节id查询,作家的接口
     */
    BookIndexInfo queryById(Long indexId);

    List<BookIndexInfo> queryLastIndices(Long id);

    /**
     * 读者的接口
     * @param indexId
     * @return
     */
    BookIndexInfo readerQueryIndexById(Long indexId);

    /**
     * 查询章节目录
     * @param bookId
     * @return
     */
    List<BookIndexInfo> queryIndicesByBookId(Long bookId);

    void deleteById(Long id);
}
